home *** CD-ROM | disk | FTP | other *** search
/ Amiga MA Magazine 1998 #3 / amigamamagazinepolishissue1998.iso / maksiu / lists / amoslist-1295.lzh / AMOSLIST / 000037_comlink.mpx.co…et!amos-request_Thu, 25 May 95.msg < prev    next >
Text File  |  1995-12-31  |  4KB  |  94 lines

  1. 04:48:15 1100
  2. Date: Wed, 24 May 1995 04:21:54 -0400 (EDT)
  3. Message-Id: <Pine.SUN.3.91.950524022739.25511A-100000@mothra.syr.edu>
  4. From: Tim Wright <tewright@mailbox.syr.edu>
  5. Subject: Re: point and Ham
  6.  
  7. On Tue, 23 May 1995, Robert Currie wrote:
  8. >    The way HAM works is that the first pixel of every line defines a
  9. > color. The pixel beside it changes only one aspect of that color, either
  10. the
  11. > red, green or blue aspect. This pattern is repeated across the entire
  12. line
  13. > of  the graphics screen, each pixel only containing the change in one
  14. aspect
  15. pf
  16. > the color. By getting the pixel color, you are really only getting the
  17. value
  18. > of the change in one aspect of the previouse color. To calculate the
  19. color
  20. you
  21. > must actually apply the changes made to the first pixel of the line up to
  22. and
  23. > including the pixel in question. I am not sure of the exact form of the
  24. changes
  25. > as in which change goes in which order(I think it is Red then Green then
  26. Blue)
  27. > but I am sure someone could supply you with that information.
  28. >                   Robert Currie
  29.  
  30.    HAM mode uses a base of 16 colors.  AMOS treats these like the colors of
  31.  
  32. any ordinary 16 color screen.  A color index value of 0-15 in AMOS 
  33. functions refers to one of these base colors.
  34.    HAM stands for 'Hold And Modify'.  To display its thousands of colors, 
  35. HAM 'Holds' the value of a pixel and allows you to 'Modify' the red, green,
  36.  
  37. or blue value of the pixel to the right of it.  Color index values 16-63 
  38. refers to the value the previous pixel is modified by:
  39.  
  40.   values 16-31: replace previous BLUE value  (new intensity=value-16)
  41.   values 32-47: replace previous RED value   (new intensity=value-32)
  42.   values 48-63: replace previous GREEN value (new intensity=value-48)
  43.  
  44. Example:
  45.   Color 1,$fff        <- set index 1 to all white 
  46.   Plot 1,1,1          <- plot white pixel on screen
  47.   Plot 2,1,50         <- modifies the green value of the previous pixel to
  48.                          very dim value.  This second pixel will be very 
  49.                          magenta.
  50.  
  51. So... If you are trying to find the RGB value of a point on a HAM screen, 
  52. its a tad messy.  You have to keep checking points to the left until you 
  53. find a base color; reach the beginning of the line; or come across a 
  54. modified red, green, and blue value.  Here's a rough outline that sould
  55. work:
  56.  
  57. CHECK THE CURRENT POINT
  58.    if it has index value 0-15
  59.       use the colour function to get the RGB value
  60.       if this is not your first check
  61.          modify with the value(s) you are keeping track of
  62.       DONE
  63.    else
  64.       if you are not keeping track of this color already
  65.          remember the modified color and intensity
  66.          if you are now keeping track of a red, green, and blue value
  67.             use this value with the other ones you have
  68.             DONE
  69.       if this is the first horizontal pixel
  70.          use the value(s) you have, and use 0 for the missing one(s)
  71.          DONE
  72.       else
  73.          move one pixel to the left, and GO BACK TO THE BEGINNING
  74.  
  75. I did once write a recursive procedure that did this but it was painfully 
  76. slow and I deleted it. :}
  77.  
  78. -======}=*   Tim Wright  -  "Argh!"  -  tewright@mailbox.syr.edu  
  79. *={======-
  80.  
  81. Hope this helps.
  82.  
  83. Darryl
  84.  
  85. -- Via DLG Pro v1.0
  86.  
  87.                #####\             _             /#####
  88.                #( )# |          _( )__         | #( )# 
  89.                ##### |         /_    /         | #####
  90.                #" "# |     ___m/I_ //_____     | #" "#
  91.                # O # |____#-x.\ /++m\ /.x-#____| # O #
  92.                #m.m# |   /" \ ///###\\\ / "\   | #m.m#
  93.                #####/    ######/     \######    \#####